<!doctype html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"><head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
	<meta name="author" content="Coderthemes">
	
	<script src="/static/plugins/printWorld/PrintWorld.js"></script>
</head>
<body>
	
	<button type="button" onclick="doReview()">预览商品标</button>
	<button type="button" onclick="doPrint()">打印商品标</button>
	<script>

	var json = {};	
	json.action = "print";	//打印指令动作。json.action = "preview"，则生成预览。
	json.template = "http://localhost:8089/static/plugins/printWorld/muban/goods.fmx";	//模板URL，位于WEB服务器的一个模板文件。
	json.data = [{
		"barcode":"BDD1234567",
		"barcodetext":"BDD1234567",
		"nameEn":"EXCEART Guide Sticker Cello Fret Finger",
		"nameCn":"大提琴指板音标贴纸1个装"
	},{
		"barcode":"BDD1234567",
		"barcodetext":"BDD1234567",
		"nameEn":"EXCEART Guide Sticker Cello Fret Finger",
		"nameCn":"大提琴指板音标贴纸1个装"
	}];	//填充模板的JSON数据对象。数组则批量打印。
	// json.printer=printerName;	//打印机名称。为空或者不指定，则通过缺省打印机打印。
	
	function doReview() {
		json.action = "preview";
		var pw = GetPrintWorld();	//获取打天下对象
		pw.Act(json);
	}
	
	function doPrint() {
		json.action = "print";
		var pw = GetPrintWorld();	//获取打天下对象
		pw.Act(json);
	}
	</script>
</body>
</html>